<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>1~100之间的所有整数“求和”和“求平均值”</title>
    <script>
        var sum = 0;
        for(var i = 1;i <= 100; i++){
            sum += i;
        }
        console.log('求和：'+ sum);        //计算结果：5050
        console.log('求平均值：'+ (sum / 100));      //计算结果：50.5
    </script>
</head>
<body>

</body>
</html>